Skip to main content

Fibonacci

You will solve this exercise starting from the fibonacci.asm file located in the drills/tasks/fibonacci directory.

Calculate the Nth Fibonacci number, where N is given through the eax register.

NOTE: The fibonacci series goes as follows : 0, 1, 1, 2, 3, ... where each element f[i] = f[i-2] + f[i-1], except for the first two elements.

TIP: For example, if the value stored in eax is equal to 5, a correct solution will display 3 and for 7, it will display 8.

If you're having difficulties solving this exercise, go through this reading material.